<?php

/*
 * 会员编辑
 */

namespace Admin\Func;

class Func909010102 {

    var $db;
    var $rst;
    var $errmsg;
    var $VIPNo;
    var $VIPLoginCode;
    var $VIPName;
    var $VIPNickName;
    var $VIPPhoneNo;
    var $Sex;
    var $BirthDay;
    var $Mail;
    var $VIPType;
    var $VIPLevel;
    var $VIPFigthValue;
    var $VIPIMG;
    var $VIPSIMG;

    public function __construct($VIPNo, $VIPLoginCode, $VIPName, $VIPNickName, $VIPPhoneNo, $Sex, $BirthDay, $Mail, $VIPType, $VIPLevel, $VIPFigthValue, $VIPIMG, $VIPSIMG) {
        $this->db = new \Think\Model();
        $this->errmsg = '';
        $this->VIPNo = addslashes($VIPNo);
        $this->VIPLoginCode = addslashes($VIPLoginCode);
        $this->VIPName = addslashes($VIPName);
        $this->VIPNickName = addslashes($VIPNickName);
        $this->VIPPhoneNo = addslashes($VIPPhoneNo);
        $this->Sex = addslashes($Sex);
        $this->BirthDay = addslashes($BirthDay);
        $this->Mail = addslashes($Mail);
        $this->VIPType = addslashes($VIPType);
        $this->VIPLevel = addslashes($VIPLevel);
        $this->VIPFigthValue = addslashes($VIPFigthValue);
        $this->VIPIMG = addslashes($VIPIMG);
        $this->VIPSIMG = addslashes($VIPSIMG);
    }

    /*
     * 获取错误信息
     */

    public function getErrMsg() {
        return $this->errmsg;
    }

    /*
     * 验证
     */

    private function validate() {
        return true;
    }

    /*
     * 执行
     */

    public function execute() {
        $vflag = true;
        $OperID = I('OperID');
        if ($this->validate()) {

            $sql = <<<EOD
UPDATE t_lz_vs_viper_basic t
SET T.VIPNo = '$this->VIPNo',
T.VIPLoginCode = '$this->VIPLoginCode',
T.VIPName = '$this->VIPName',
T.VIPNickName = '$this->VIPNickName',
T.VIPPhoneNo = '$this->VIPPhoneNo',
T.Sex = '$this->Sex',
T.BirthDay = '$this->BirthDay',
T.Mail = '$this->Mail',
T.VIPType = '$this->VIPType',
T.VIPLevel = '$this->VIPLevel',
T.VIPFigthValue = '$this->VIPFigthValue',
T.VIPIMG = '$this->VIPIMG',
T.VIPSIMG = '$this->VIPSIMG',
T.OperID = '$OperID',
T.OperDate = now()
WHERE T.VIPNo = '$this->VIPNo'

EOD;

            //$this->rst = $this->db->query($sql);
            $this->rst = $this->db->execute($sql);
            if ($this->rst === false) {
                $this->errmsg = $this->db->getDbError();
                $vflag = false;
            } else {
                $vflag = true;
            }
        } else {
            $vflag = false;
        }
        return $vflag;
    }

    public function getRst() {
        return $this->rst;
    }

}
